import os
import platform

f = open("BiliBiliHelper.spec","w")
f.write("# -*- mode: python -*-\n")
f.write("\n")
f.write("import sys\n")
f.write("sys.path.append(\"Src\")\n")
f.write("\n")
f.write("block_cipher = None")
f.write("\n")
f.write("\n")
f.write("\n")
f.write("a = Analysis(['main.py'],\n")
if platform.system().lower() != "windows":
    f.write("             pathex=['%s'],\n"%os.getcwd())
else:
    f.write("             pathex=[r'%s'],\n"%os.getcwd())
f.write("             binaries=[],\n")
f.write("             datas=[],\n")
f.write("             hiddenimports=[],\n")
f.write("             hookspath=[],\n")
f.write("             runtime_hooks=[],\n")
f.write("             excludes=[],\n")
f.write("             win_no_prefer_redirects=False,\n")
f.write("             win_private_assemblies=False,\n")
f.write("             cipher=block_cipher,\n")
f.write("             noarchive=False)\n")
f.write("pyz = PYZ(a.pure, a.zipped_data,\n")
f.write("             cipher=block_cipher)\n")
f.write("exe = EXE(pyz,\n")
f.write("          a.scripts,\n")
f.write("          a.binaries,\n")
f.write("          a.zipfiles,\n")
f.write("          a.datas,\n")
f.write("          [],\n")
f.write("          name=\'BiliBiliHelper\',\n")
f.write("          debug=False,\n")
f.write("          bootloader_ignore_signals=False,\n")
f.write("          strip=False,\n")
f.write("          upx=True,\n")
f.write("          runtime_tmpdir=None,\n")
f.write("          console=True )")
f.close()